	<HTML>
	<head><title>MAY IN</title></head><br>
<form method= POST action ="">
	<H1><CENTER><FONT COLOR="BLUE"> MAY IN </FONT></CENTER></H1>
	<HR WIDTH=50%>
	<CENTER>
	<FONT COLOR= BLUE SIZE=5>
    <br>Trong luong may: <input type=text name="trongluongmay">
  <br>Nam san xuat :  <input type=text name="namsanxuat">
  <br>Hang san xuat : <input type=text name="hangsanxuat">
  <br>So kim:         <input type=text name="sokim">
  <br>Toc do in 1:    <input type=text name="tocdoin1">
  <br>Do phan giai :   <input type=text name="dophangiai">
<br>Toc do in 2:      <input type=text name="tocdoin2">  
  <br><INPUT TYPE=SUBMIT NAME="thuc hien" VALUE="thuc hien">
   <INPUT TYPE=RESET NAME="xoa" VALUE="xoa"><br>
 <HR WIDTH=50%>
<?php
 if(isset($_POST["trongluongmay"])&&isset($_POST["namsanxuat"])&&isset($_POST["hangsanxuat"])&&isset($_POST['sokim'])&&isset($_POST['tocdoin1'])&&isset($_POST["dophangiai"])&&isset($_POST["tocdoin2"]))
{
        $trongluongmay=$_POST["trongluongmay"];
		$namsanxuat=$_POST["namsanxuat"];
		$hangsanxuat=$_POST["hangsanxuat"];
		$sokim=$_POST['sokim'];
		$tocdoin1=$_POST['tocdoin1'];
	    $dophangiai=$_POST["dophangiai"]; 
		$tocdoin2=$_POST["tocdoin2"]; 
          class mayin
{
        public $trongluongmay;
        public $namsanxuat;
        public $hangsanxuat;
        function nhap($trongluongmay,$namsanxuat,$hangsanxuat)
        {
            $this->trongluongmay=$trongluongmay;
            $this->namsanxuat=$namsanxuat;
            $this->hangsanxuat=$hangsanxuat;
        }
	   function xuatmayin()
	    {
				 $trongluongmay=(is_numeric($this->trongluongmay)==1&&$this->trongluongmay>0 && $this->trongluongmay!=null)?$this->trongluongmay:" null";
							 {
							      echo "<br> trong luong may: ".$trongluongmay; 
                              }	
                         $namsanxuat=(is_numeric($this->namsanxuat)==1 && strlen($this->namsanxuat)==4 && $this->namsanxuat>1990)?$this->namsanxuat:"  null";
						      {
							      echo "<br> nam san xuat : ".$namsanxuat;	
							  }
						  $hangsanxuat=(is_numeric($this->hangsanxuat)!=1&&($this->hangsanxuat)!=null)?$this->hangsanxuat:"  null";
                              {
                                  echo "<br> hang san xuat : ".$hangsanxuat;
                              }							  
				    
		 } 	  
}
 
 
       class mayinkim extends mayin
              {
						public $sokim;
						public $tocdoin1;
						function nhapmayinkim($trongluongmay,$namsanxuat,$hangsanxuat,$sokim,$tocdoin1)
						{
							$this->nhap($trongluongmay,$namsanxuat,$hangsanxuat);
							$this->sokim=$sokim;
							$this->tocdoin1=$tocdoin1;
						}	 
                        function xuatmayinkim()
				       {   

      					   $this->xuatmayin();
						       $sokim=$_POST['sokim']; 
							  $tocdoin1=$_POST['tocdoin1'];
						        $sokim=(is_numeric($sokim)==1&&$this->sokim>0 )? $this->sokim:"null";
									echo "<br> So kim: ".$this->sokim;
							
                               $tocdoin1=(is_numeric($tocdoin1)==1&&$this->tocdoin1>0)? $this->tocdoin1:" null";   
                                  echo "<br> Toc do in 1: ".$this->tocdoin1;
                              
					    }	 	  	 
           	  } 
			  
			  class mayinlaser extends mayin
              {
						public $dophangiai;
						public $tocdoin2;
						function nhapmayinlaser($trongluongmay,$namsanxuat,$hangsanxuat,$dophangiai,$tocdoin2)
						{
							$this->nhap($trongluongmay,$namsanxuat,$hangsanxuat);
							$this->dophangiai=$dophangiai;
							$this->tocdoin2=$tocdoin2;
						}	 
                        function xuatmayinlaser()
				       {   

      					   $this->xuatmayin();
						    $dophangiai=$_POST['dophangiai']; 
							  $tocdoin2=$_POST['tocdoin2'];
							 $dophangiai=(is_numeric($dophangiai)!=1&&$dophangiai>0)?$this->dophangiai:"null";  
									echo "<br> do phan giai : ".$this->dophangiai;
                              $tocdoin2=(is_numeric($tocdoin2)==1&& $this->tocdoin2>0)?$this->tocdoin2:"null "; 
									echo "<br> Toc do in 2: ".$this->tocdoin2;
                              
					    }	 	  	 
           	  } 
			  
$mayinkim= new mayinkim();
$mayinkim->nhapmayinkim($trongluongmay,$namsanxuat,$hangsanxuat,$sokim,$tocdoin1);
$mayinlaser= new mayinlaser();
$mayinlaser->nhapmayinlaser($trongluongmay,$namsanxuat,$hangsanxuat,$dophangiai,$tocdoin2);
$mayinkim->xuatmayinkim();
 $mayinlaser->xuatmayinlaser(); 
} 
?>

 </html>				